<?php

use yii\helpers\Html;
use yii\bootstrap\ActiveForm;

$this->title = '会员登录';
$this->params['breadcrumbs'][] = $this->title;
?>

		
<style type="text/css">
	body{background: url(/img/bg_login.png)  top center no-repeat;
		width:100%;
		height:100%;
		background-attachment: fixed;
  		-webkit-background-size: cover;
  		-moz-background-size: cover;
  		-o-background-size: cover;
  		background-size: cover;
	}
   
	.tel{color: #FFF;}
	.mui-table-view-cell:after{left:0}
	.text-center{text-align: center;}
	.test{padding: 15px 0;}
	.title{color: #f0ad4e;font-weight: bold;}
	
	.mui-icon{font-size: 30px}
	.mui-bar-transparent{top:0;background-color:rgba(247,247,247,0);-webkit-box-shadow:none;box-shadow:none}
	.mui-btn-block{padding: 5px 0px;}
	.menu-list{color: #FFF;margin-top: 40px;}
	.menu-list .mui-icon{font-size: 20px;}

	.link-area{margin:15px;}
	.text-center{text-align: center;}
	.mui-input-group .mui-input-row:after{left: 0}
	.mui-bar-transparent{top:0;background-color:rgba(247,247,247,0);-webkit-box-shadow:none;box-shadow:none}
	#login-form{margin-top: 20px;}

	.help-block.help-block-error{color: red;text-align: center;}
	.has-error input{border: 1px solid red !important;}
	#forgetPassword{color: #626262;}
	.mui-input-group:before{background-color:#efeff4;}
    .mui-input-group:after{background-color:#efeff4;}
    .mui-btn-pink{background-color:rgb(166,100,166);border:1px solid rgb(166,100, 166);color: #FFFFFF; }
    .mui-input-group:before{background-color: transparent;}
    .mui-input-group:after{background-color: #FFFFFF;}
    .lab1{color: #FFFFFF;padding:10px;border-right: 0.5px solid #FFFFFF;width: 20% !important;padding: 8px 15px !important;text-align: center;}
    .icon3{font-size: 1.6rem;}
    .input1{color: #FFFFFF !important;background-color: transparent !important;width: 70% !important;}
	
</style>
<div class="mui-content">
		<div class="mui-scroll">

			<div class="mui-row">
				<div class="mui-col-xs-12" style="text-align: center;margin-top:40px;">
					<img src="/img/logo.png" style="width:40%;" >
				</div>	
			</div>
			

			<div class="mui-row" style="margin-top: 40px;">
				<div class="mui-col-xs-12" style="width: 90%;margin-left: 5%" >
						<form id="member-form" method="post" action="/member/member/login">
						    <input type="hidden" value="<?php echo Yii::$app->getRequest()->getCsrfToken(); ?>" name="_csrf" />
							<div class="mui-input-group mui-input-row" style="background-color: transparent;border-top: 0;"> 
								  <label class="lab1"><i class="iconfont icon3">&#xe801;</i></label>
        						  <input type="text" name="login-form[login]" id="member-username" class="input1"  placeholder="请输入您的用户名或邮箱">
							</div>

							<div class="mui-input-group mui-input-row" style="background-color: transparent;margin-top: 20px;">  
								<label class="lab1"><i class="iconfont icon3">&#xe74d;</i></label>
        						<input class="input1" name="login-form[password]" id="member-password" type="password"  placeholder="请输入您的密码">
							</div>
							
							<input type="hidden" value="<?=$openId['openid']?>" name="User[openId]" /> 

							<div class="mui-col-xs-12" style="margin-bottom: 2rem">
								
							</div>
						</form>
						 <?= Html::submitButton('登 录' , ['class'=>'mui-btn mui-btn-block mui-btn-pink','id'=>'login-form']) ?>
				</div>	
			</div>	
			
			
		</div>
</div>


<?php app\components\JsBlock::begin() ?>
<script type="text/javascript">

mui.init();
mui('body').on('tap','a[data-link="as"]',function(){document.location.href=this.href;});

mui('body').on('tap',"#login-form",function(){
	var username = $("#member-username").val();
    var password = $("#member-password").val();

    if(username == ''){
        mui.toast('用户名不能为空');
        return false;
    }
    if(password == ''){
        mui.toast('密码不能为空');
        return false;
    }
    
    $("#member-form").submit();
    
//    	$.ajax({
//            type: "post",
//            async:false, 
//            url: "/member/member/login-json",
//            data: $('#member-form').serialize(),
//            success: function(res){
//            	    var res = $.parseJSON(res);
//                 if(res.code == 0){
//                 	mui.toast(res.msg);
//                 	return false;
//                 }else if(res.code == 1){
//                 	mui.toast(res.msg);
//                 	localStorage.setItem('user_id',res.data.user_id); 
//   					localStorage.setItem('username',res.data.username); 
// 					localStorage.setItem('email',res.data.email);
// 					window.location.href='/member/member/order?user_id='+res.data.user_id+'&username='+res.data.username; 
//                 }
//            }
//     });


});

</script>
<?php app\components\JsBlock::end() ?>		
